﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UwinEducation.Domain.Entities;

namespace UwinEducation.Domain.IRepositories
{
    public interface IRolePermissionRepository : IRepository<RolePermission, Guid>
    {
        /// <summary>
        /// 获取用户的所有权限代码
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>权限代码列表</returns>
        Task<List<string>> GetPermissionCodesByUserIdAsync(Guid userId);

        /// <summary>
        /// 获取用户的角色信息列表
        /// </summary>
        Task<List<string>> GetRoleCodesByRoleIdAsync(Guid roleId);

        /// <summary>
        /// 检查用户是否拥有指定权限
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="permissionCode">权限代码</param>
        /// <returns>是否拥有权限</returns>
        Task<bool> UserHasPermissionAsync(Guid userId, string permissionCode);
    }
}
